home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / comm / rs232101.zip / RS232.DOC < prev    next >
Text File  |  1993-07-01  |  35KB  |  843 lines

  1. **************************************************************************
  2.  
  3.                     RS232
  4.                 Version  1.01
  5.                   Ring  Development
  6.                Maple Grove,  Minnesota
  7.  
  8. **************************************************************************
  9.  
  10.      The files created during extraction are as follows :      
  11.  
  12.      FILE                        SIZE
  13.      --------------------------------
  14.      RS232.    DOC              34840
  15.      RS232.    EXE              15620
  16.      RS232A.   EXE               7920
  17.      XT.       EXE               3720
  18.      TY.       EXE               7620
  19.      TYBIG.    EXE               9240
  20.      ADDLINES. EXE               6525
  21.      READ.     ME                3170
  22.      ORDER.    FRM               1220
  23.  
  24. **************************************************************************
  25.  
  26.                   TABLE  OF  CONTENTS
  27.                   -------------------
  28.  
  29.     1    Introduction
  30.      1.1  Program Installation
  31.     2    RS-232 Basics
  32.     3    RS232 Program Usage
  33.      3.1  Cabling to PC
  34.      3.2  Theory of Operation
  35.      3.3  User Interface
  36.      3.4  Command Line Arguments
  37.      3.5  If you have a real slow PC and/or fast baud rate - Overrun Error
  38.     4    Utility Program Usage
  39.      4.1  RS232A
  40.      4.2  XT
  41.      4.3  TY
  42.      4.4  TYBIG
  43.      4.5  ADDLINES
  44.     5    Closing
  45.  
  46. **************************************************************************
  47.  
  48.     1    INTRODUCTION
  49.  
  50.      The RS232 program here should enable you to debug most of your
  51.      RS-232 problems much faster than before. With the program, you
  52.      can actually see the data transmitted in both directions on a real
  53.      time basis. The program also supports the monitoring of all hardware
  54.      lines for those nasty hardware handshaking problems.
  55.  
  56.      5 utility programs are also provided to aid in wading through the
  57.      data generated. These utilities are described in Section 4.
  58.  
  59.      There are no hardware changes needed in the PC, the program does
  60.      all the monitoring necessary through the 2 COM ports. The program
  61.      can be used if your PC has only 1 COM port, though the program
  62.      will give the most beneficial information if you have 2. Nowadays,
  63.      a second COM port can be added to any PC for a minimum investment.
  64.  
  65.      The hardware needed to use this program is a simple homemade cable
  66.      that you create. The cable you need can be probably be built in an
  67.      hour from spare parts lying around. Section 3.1 discusses the cable
  68.      that most likely will be the one you need.
  69.  
  70.  
  71.     1.1  PROGRAM INSTALLATION
  72.  
  73.      Installing the RS232 program and the associated utilities is quite
  74.      simple. It is simply a matter of copying the .EXE files to any
  75.      directory where you want to run the program(s). A more versatile
  76.      directory would be a directory that is already in the 'PATH' of
  77.      the PC. This enables operation of the program(s) from any place
  78.      on the disk. A typical directory in the PATH is \DOS.
  79.  
  80.      To copy the program(s) to the \DOS directory :
  81.  
  82.      1) COPY *.EXE \DOS        (copy files to \DOS)
  83.  
  84.      To copy the program(s) to a new directory (ex \RS232) :
  85.  
  86.      1) MD \RS232              (make RS232 directory)
  87.      3) COPY *.EXE \RS232      (copy files to \RS232)
  88.  
  89.  
  90. **************************************************************************
  91.  
  92.     2    RS-232 BASICS
  93.  
  94.      RS-232 is a communication standard that has existed for many
  95.      years. It's main purpose is to transfer data from one device
  96.      to another. For instance, a tester to a host computer so the
  97.      computer can store the test results on disk.
  98.  
  99.      The standard RS-232 connector has 25 pins, though a lot of
  100.      PC's have a 9 pin connector. The pin assignments for each
  101.      signal is as follows (for 25 and 9 pin connectors) :
  102.  
  103.  
  104.                      TABLE  I
  105.  
  106.      SIGNAL                      PIN # (25)   PIN # (9)     IN/OUT
  107.      -------------------------------------------------------------
  108.      Ground                          1           N/A          --
  109.      Transmit Data                   2            3           Out
  110.      Receive Data                    3            2           In
  111.      Request to Send     (RTS)       4            7           Out
  112.      Clear to Send       (CTS)       5            8           In
  113.      Data Set Ready      (DSR)       6            6           In
  114.      Signal Ground                   7            5           --
  115.      Data Carrier Detect (DCD)       8            1           In
  116.      Data Terminal Ready (DTR)      20            4           Out
  117.      Ring Indicator      (RI)       22            9           In
  118.  
  119.      Note that besides receive/transmit data, there are 2 output
  120.      lines and 4 input lines. These are used for modem control and
  121.      hardware handshaking, which will be discussed later.
  122.  
  123.      The simplest communication hookup has 3 wires; transmit data,
  124.      receive data, and signal ground. The transmit and receive lines
  125.      need to be crossed (whether in the connecting cable or internal
  126.      to the either device). See Figure 1. This is so the transmit
  127.      line of device 1 is tied to the receive line of device 2, and
  128.      vice versa.
  129.  
  130.      This configuration only supports software handshaking. Suppose
  131.      device 1 transmits a block of data to device 2. Once device 2 has
  132.      received the data, it transmits back to device 1. Device 2 can
  133.      transmit a character meaning "OK, send the next block of data" or
  134.      transmit a character meaning "I don't like the data, send that last
  135.      block of data again". The actual protocol used is determined by
  136.      the software running on both devices.
  137.  
  138.  
  139.      DEVICE 1 (25 Pin)                         DEVICE 2 (25 Pin)
  140.  
  141.      PIN  2----------------\  /--------------------PIN  2     Transmit
  142.                 \/
  143.                 /\
  144.      PIN  3----------------/  \--------------------PIN  3     Receive
  145.  
  146.  
  147.      PIN  7----------------------------------------PIN  7     Signal GND
  148.  
  149.  
  150.                  (FIGURE 1)
  151.  
  152.  
  153.      Another configuration uses 5 wires and this is used primarily
  154.      for a hardware handshaking protocol. It uses the 3 wires in
  155.      Figure 1 and also the 2 wires shown in Figure 2.
  156.  
  157.  
  158.      DEVICE 1 (25 Pin)                         DEVICE 2 (25 Pin)
  159.  
  160.      PIN  4----------------\  /--------------------PIN  4     RTS
  161.                 \/
  162.                 /\
  163.      PIN  5----------------/  \--------------------PIN  5     CTS
  164.  
  165.  
  166.  
  167.                  (FIGURE 2)
  168.  
  169.  
  170.      From Table I above, you see that pin 4 (RTS) is an output signal
  171.      and pin 5 (CTS) is an input signal. No data is transferred through
  172.      these pins. They are just control lines using a specific voltage
  173.      level for the high state and another voltage level for the low
  174.      state. The software running in device 1 can program pin 4 to be
  175.      high or low and then device 2 can read this value as high/low
  176.      and act accordingly. Here is a typical example. Suppose device 1
  177.      is a large mainframe and device 2 is a tester of some sort. Now
  178.      assume that there are many testers (say 10) and all are hooked
  179.      up to our mainframe (one tester on 10 different mainframe COM
  180.      ports), our central data gathering point. It would be difficult
  181.      for our mainframe to gather data on all 10 testers simultaneously,
  182.      so we implement a hardware handshaking protocol. Our protocol says:
  183.      "A tester can not transmit it's test results until it sees the CTS
  184.      line go high". If the CTS line is low, our tester will not transmit
  185.      it's test results. So now, all our mainframe software has to do is:
  186.  
  187.      1)  Set the RTS line on the port for tester 1 high, this sets
  188.          the CTS line high at tester 1.
  189.      2)  Tester 1 sees that CTS has gone high, then it starts its
  190.          transmission of the test results.
  191.      3)  After completion of the test results, set the RTS line low
  192.          for tester 1. This will inhibit tester 1 from further
  193.          transmissions.
  194.      4)  Now set the RTS line for tester 2, and repeat the above
  195.          steps for all 10 testers.
  196.  
  197.  
  198.      Pins 20 and 6 may also be used as pins 4 and 5 were above.
  199.      Another possible use for the input pins is to connect an
  200.      input pin to a +5V signal in the remote device (for example,
  201.      a power supply voltage). This is convenient if the remote
  202.      device is not always powered on. Your program in essence can
  203.      monitor the power supply of the remote device and know when
  204.      it is powered up and safe to 'talk' to.
  205.  
  206.      Pins 8 (DCD) and 22 (RI) are normally used in commu